package com.jeeplus.modules.graph.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.modules.commit.entity.StudentSubmit;
import com.jeeplus.modules.graph.entity.ByReason;
import com.jeeplus.modules.graph.entity.Choice;
import com.jeeplus.modules.graph.entity.Evaluation;
import com.jeeplus.modules.graph.entity.GraphPairDataUI;
import com.jeeplus.modules.studentevaluate.entity.StudentEvaluate;
import com.jeeplus.modules.sys.entity.StudentMoreduMain;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 图表Mapper
 * Created by 于昭龙 on 2022/5/4.
 */
@Mapper
@Repository
public interface GraphMapper extends BaseMapper<StudentSubmit> {

    /**
     * 通过传入的parent_ids返回对应的子机构
     * @param ids 路径
     * @return
     */
    public List<String> getOffices(String ids);

    /**
     * 查一个系里有多少个年级
     * @param ids 路径
     * @return
     */
    public Integer getCountYearFromInstitute(String ids);

    /**
     * 查一个年级有多少个班级
     * @param ids 路径
     * @return
     */
    public Integer getCountClassFromYear(String ids);

    /**
     * 查一个年级有多少个班级
     * @param studentMoreduMain 存储学院 年级 班级
     * @return
     */
    public Integer getStudetsFromClass(StudentMoreduMain studentMoreduMain);

    /**
     * 根据传入的学院、年级、班级查询有多少个学生(后期改造生成班级排名)
     * @param studentMoreduMain 中间有三个主要参数 学院 年级 班级
     * @return
     */
    public List<StudentMoreduMain> getStudentsFromOffice(StudentMoreduMain studentMoreduMain);

    List<StudentMoreduMain> findList(StudentMoreduMain studentMoreduMain);

    List<ByReason> byReason(StudentMoreduMain studentMoreduMain);

    List<ByReason> byReasonContrast(StudentMoreduMain studentMoreduMain);

    List<ByReason> byReasonContrastAve(StudentMoreduMain studentMoreduMain);

    List<ByReason> totalPeople(StudentMoreduMain studentMoreduMain);

    List<ByReason> byInstitute(ByReason studentMoreduMain);

    List<ByReason> byInstituteC(ByReason studentMoreduMain);

    List<ByReason> byInstituteG(ByReason studentMoreduMain);

    List<ByReason> byInstituteI(ByReason studentMoreduMain);

//    List<Evaluation> isEvaluate(Evaluation evaluation);

    List<GraphPairDataUI> regional(StudentEvaluate studentEvaluate);

    List<ByReason> byInstituteContrast(ByReason studentMoreduMain);

    List<ByReason> byInstituteContrastAve(ByReason studentMoreduMain);

    List<Evaluation> organizatioEvaluationSituation(Evaluation evaluation);

    List<Evaluation> evaluationSituation(Evaluation evaluation);

    List<Evaluation> allEvaluationSituation(Evaluation evaluation);

    List<Choice> getGrade();
    List<Integer> queryRange(StudentMoreduMain studentMoreduMain);
    Map<String, Double> queryRangeMax (StudentMoreduMain studentMoreduMain);
}
